package com.bdqn.wang.util;

import java.util.ArrayList;
import java.util.List;

public class Page<T> {
    //总页数
    private int totalPage;

    //总记录数
    private int totalCount;

    //每页显示数据条数
    private int pageSize = 10;

    //当前页
    private int currentPage;

    //泛型集合
    private List<T> list = new ArrayList<T>();

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage() {
        this.totalPage = this.totalCount % this.pageSize == 0 ? this.totalCount / this.pageSize : this.totalCount / this.pageSize + 1;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
